package cn.rocky.prepare;

/**
 * 是否是子序列
 */
public class isSubsequence {

    /**
     * 检查是否是子序列
     * @param args0 子序列
     * @param args1 序列
     * @return
     */
    public static boolean isSubsequence(String args0, String args1) {
        if (args0.length() == 0) { return false;}
        int a = 0;
        for (int i = 0; i < args1.length(); i++) {
            if (args0.charAt(a) == args1.charAt(i)) {
                a++;
            }
            if (a == args0.length()) {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {

    }
}
